import request from "@/utils/request";
// 获取用户列表
export function getRoleList(limit, page) {
    return request({
        url: `/api/v1/role/getRoleList/${limit}/${page}`,
        method: "get",
    });
}
// 添加角色
export function addRole(data) {
    return request({
        url: `/api/v1/role/addRole`,
        method: "post",
        data
    });
}
// 查询角色拥有的权限
export function getPermissionsByRoleId(role_id) {
    return request({
        url: `/api/v1/role/getPermissions/${role_id}`,
        method: "get",
    });
}
// 编辑角色
export function EditRole(data) {
    return request({
        url: `/api/v1/role/alter`,
        method: "put",
        data
    });
}
// 删除角色
export function DeleteRole(id) {
    return request({
        url: `/api/v1/role/deleteById/${id}`,
        method: "delete",
    });
}
// 模糊搜索用户
export function SearchRoles(fuzzyName, limit, page) {
    return request({
        url: `/api/v1/role/query/fuzzy/${fuzzyName}/${limit}/${page}`,
        method: "get",
    });
}
// 为角色绑定权限
export function bindPermission(data) {
    return request({
        url: "/api/v1/role/bindPermission",
        method: "post",
        data
    });
}
// 获取角色的权限
export function getPermissionListById(id) {
    return request({
        url: `/api/v1/role/getPermissions/${id}`,
        method: "get",
    });
}
export function BatchDeleteRole(data) {
    return request({
        url: `/api/v1/role/batch/delete`,
        method: "delete",
        data
    });
}
/// 获取所有角色
export function getAllRoleList() {
    return request({
        url: `/api/v1/role/getRoleListWithoutPage`,
        method: "get",
    });
}